<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/1
 * Time: 21:35
 */

//Oauth
Route::group(['prefix' => 'oauth','namespace'=>'Home'], function () {
    // 重定向
    Route::get('redirectToProvider/{service}', 'OAuthController@redirectToProvider');
    // 获取用户资料并登录
    Route::get('handleProviderCallback/{service}', 'OAuthController@handleProviderCallback');
    // 退出登录
    Route::get('logout', 'OAuthController@logout');
});

//JWT 测试玩玩的
Route::group([
    'namespace'=>'Home',
    'middleware' => 'api',
    'prefix' => 'auth'

], function ($router) {
    Route::post('login', 'AuthController@login');
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::post('me', 'AuthController@me');
});

Route::group(['namespace' => 'Home'], function () {
    Route::get('email/send','IndexController@send');
    // 首页
    Route::get('/', 'IndexController@index');
    // 分类
    Route::get('category/{id}', 'IndexController@category');
    // 标签
    Route::get('tag/{id}', 'IndexController@tag');
    //关于本站
    Route::get('about', 'IndexController@about');
    // 随言碎语
    Route::get('timeline', 'IndexController@timeline');
    // 开源项目
    Route::get('production', 'IndexController@production');
    //全部文章
    Route::get('article', 'IndexController@article');
    // 文章详情
    Route::get('article/detail/{id}', 'IndexController@detail');
    // 文章评论
    Route::any('comment', 'IndexController@comment');
    //全部文章
    ROute::get('article/all','IndexController@all');
    // 检测是否登录
    Route::get('checkLogin', 'IndexController@checkLogin');
    //退出
    Route::get('logout','IndexController@logout');
    // 搜索文章
    Route::get('search', 'IndexController@search');
    //点赞
    Route::post('/article/praise', 'IndexController@zan');
    // 用于测试
    Route::get('test', 'IndexController@test');
});